import request from '../utils/http'

// 获取账单列表
export function getBillList(params) {
  return request({
    url: '/bills/list',
    method: 'get',
    params
  })
}

//添加账单
export function addBill(params) {
  return request({
    url: '/bills/add',
    method: 'post',
    data: params
  })
}

// 编辑账单
export function updateBill(id, data) {
  return request({
    url: `/bills/${id}`,
    method: 'put',
    data
  })
}

//查看账单
export function getBillById(id) {
  return request({
    url: `/bills/${id}`,
    method: 'get'
  })
}

// 上传文件
export function uploadFile(data) {
  return request({
    url: "/common/upload",
    method: "post",
    data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  });
}

// 获取上传图片
export function getUploadFile(data) {
  return request({
    url: '/common/getUploadFileUrl',
    method: 'post',
    data
  })
}

// 删除图片
export function deleteUploadFile(data) {
  return request({
    url: '/common/delUploadPic',
    method: 'delete',
    data
  })
}